package API.Collections;

import java.util.ArrayList;
import java.util.Collections;

public class copy {
    public static void main(String[] args) {
        ArrayList<Integer> list1 = new ArrayList<>();
        ArrayList<Integer> list2 = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list1.add(i);
        }
        for (int i = 5; i > 0; i--) {
            list2.add(i);
        }
        Collections.copy(list2, list1);
        for(int i : list2) {
            System.out.print(i + " ");
        }
    }
}
